package com.ssyt.ec.que.entity;

import java.util.Date;

public class QuestionEntity {
	private int id;
	private String question; // '题目',
	private String attachment; // '附件（图片、视频等）',
	private String questionType; // '题型：1、单选；2、多选；3、判断。',
	private int courseId; // '对应课程表的id',
	private String answerA; // '选项A',
	private String answerB; // '选项B',
	private String answerC; // '选项C',
	private String answerD; // '选项D',
	private String answer; // '答案（多选题以拼串以形式存放）',
	private int difficulty; // '难度：1、低；2、中；3、较高；4、高。',
	private String analysis; // '分析',
	private String keywords; // '关键词（以拼串形式存放）',
	private int operateUserId; // '操作者',
	private Date operateTime; // '操作时间',
	private int state; // '状态：1、有效；2、无效。',
	private String memo; // '备注',

	// 扩展字段
	private int score;
	private String name;
	private String username;

	public String getUserName() {
		return username;
	}

	public void setUserName(String userName) {
		this.username = userName;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public QuestionEntity() {
		super();
	}

	public QuestionEntity(String question, String answerA, String answerB,
			String answerC, String answerD) {
		super();
		this.question = question;
		this.answerA = answerA;
		this.answerB = answerB;
		this.answerC = answerC;
		this.answerD = answerD;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public String getAttachment() {
		return attachment;
	}

	public void setAttachment(String attachment) {
		this.attachment = attachment;
	}

	public String getQuestionType() {
		return questionType;
	}

	public void setQuestionType(String questionType) {
		this.questionType = questionType;
	}

	public int getCourseId() {
		return courseId;
	}

	public void setCourseId(int courseId) {
		this.courseId = courseId;
	}

	public String getAnswerA() {
		return answerA;
	}

	public void setAnswerA(String answerA) {
		this.answerA = answerA;
	}

	public String getAnswerB() {
		return answerB;
	}

	public void setAnswerB(String answerB) {
		this.answerB = answerB;
	}

	public String getAnswerC() {
		return answerC;
	}

	public void setAnswerC(String answerC) {
		this.answerC = answerC;
	}

	public String getAnswerD() {
		return answerD;
	}

	public void setAnswerD(String answerD) {
		this.answerD = answerD;
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public int getDifficulty() {
		return difficulty;
	}

	public void setDifficulty(int difficulty) {
		this.difficulty = difficulty;
	}

	public String getAnalysis() {
		return analysis;
	}

	public void setAnalysis(String analysis) {
		this.analysis = analysis;
	}

	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	public int getOperateUserId() {
		return operateUserId;
	}

	public void setOperateUserId(int operateUserId) {
		this.operateUserId = operateUserId;
	}

	public Date getOperateTime() {
		return operateTime;
	}

	public void setOperateTime(Date operateTime) {
		this.operateTime = operateTime;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getStateStr() {
		if (getState() == 1) {
			return "有效";
		} else if (getState() == 2) {
			return "失效";
		} else {
			return null;
		}
	}

	public String getQuestionTypeStr() {
		if ("1".equals(getQuestionType())) {
			return "单选";
		} else if ("2".equals(getQuestionType())) {
			return "多选";
		} else if ("3".equals(getQuestionType())) {
			return "判断";
		} else {
			return null;
		}
	}

	public String getDifficultyStr() {
		if (getDifficulty() == 1) {
			return "低";
		} else if (getDifficulty() == 2) {
			return "中";
		} else if (getDifficulty() == 3) {
			return "较高";
		} else if (getDifficulty() == 4) {
			return "高";
		} else {
			return null;
		}
	}
}
